#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time       :   23:37
# Author     : Y4
# Site       : 
# File       : 循环导入1.py
# Software   : PyCharm

'''
循环导入
    A
        def test():
            f()

    B
        def f():
            test()



    开始运行的时候，
        首先就要加载  循环导入2中的func
        加载  循环导入2中的func  的时候又要加载   循环导入1中的task1


        Traceback (most recent call last):
          File "E:/workspace/python/python_learning/python模块包/循环导入1.py", line 20, in <module>
            from 循环导入2 import func
          File "E:\workspace\python\python_learning\python模块包\循环导入2.py", line 8, in <module>
            from 循环导入1 import task1
          File "E:\workspace\python\python_learning\python模块包\循环导入1.py", line 20, in <module>
            from 循环导入2 import func
        ImportError: cannot import name 'func'


    解决办法:
        重新架构
        将导入的语句放入函数里面
        把导入语句放到模块最后

'''
from 循环导入2 import func


def task1():
    print("-----------task1-------")

def task2():
    print("-----------task2-------")
    func()

if __name__ == '__main__':
    task1()
    task2()